#!/usr/local/bin/perl -w
# Parsing JCL of GB, NC, CI ...
use strict;
use Template;
require JCL;
#use CGI;

$|=1;
print "Content-type: text/html\n\n";

my $tt_file = 'jcl.html';

my $file_name=$ENV{'QUERY_STRING'};

my $dir = '/home/ftpuser/';

my $vars = {
    joblist    => &JCL::get_job_list($dir, $file_name),
###         must passing array ref. to template toolkit not array
    now        => &JCL::date_time('now'),
    file_name  => $file_name,
};


my $template = Template->new({
    INCLUDE_PATH => '/usr/lib/cgi-bin/src:/usr/lib/cgi-bin/lib',
    PRE_PROCESS  => 'config',
});

$template->process($tt_file, $vars)
    || die $template->error();

